/*
 * Selling Partner API for Orders
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.orders.v0
{
    /// <summary>
    /// Order information.
    /// </summary>
    [DataContract(Name = "Order")]
    public partial class Order : IValidatableObject
    {
        /// <summary>
        /// The current order status.
        /// </summary>
        /// <value>The current order status.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum OrderStatusEnum
        {
            /// <summary>
            /// Enum Pending for value: Pending
            /// </summary>
            [EnumMember(Value = "Pending")]
            Pending = 1,

            /// <summary>
            /// Enum Unshipped for value: Unshipped
            /// </summary>
            [EnumMember(Value = "Unshipped")]
            Unshipped = 2,

            /// <summary>
            /// Enum PartiallyShipped for value: PartiallyShipped
            /// </summary>
            [EnumMember(Value = "PartiallyShipped")]
            PartiallyShipped = 3,

            /// <summary>
            /// Enum Shipped for value: Shipped
            /// </summary>
            [EnumMember(Value = "Shipped")]
            Shipped = 4,

            /// <summary>
            /// Enum Canceled for value: Canceled
            /// </summary>
            [EnumMember(Value = "Canceled")]
            Canceled = 5,

            /// <summary>
            /// Enum Unfulfillable for value: Unfulfillable
            /// </summary>
            [EnumMember(Value = "Unfulfillable")]
            Unfulfillable = 6,

            /// <summary>
            /// Enum InvoiceUnconfirmed for value: InvoiceUnconfirmed
            /// </summary>
            [EnumMember(Value = "InvoiceUnconfirmed")]
            InvoiceUnconfirmed = 7,

            /// <summary>
            /// Enum PendingAvailability for value: PendingAvailability
            /// </summary>
            [EnumMember(Value = "PendingAvailability")]
            PendingAvailability = 8
        }


        /// <summary>
        /// The current order status.
        /// </summary>
        /// <value>The current order status.</value>
        [DataMember(Name = "OrderStatus", IsRequired = true, EmitDefaultValue = true)]
        public OrderStatusEnum OrderStatus { get; set; }
        /// <summary>
        /// Whether the order was fulfilled by Amazon (&#x60;AFN&#x60;) or by the seller (&#x60;MFN&#x60;).
        /// </summary>
        /// <value>Whether the order was fulfilled by Amazon (&#x60;AFN&#x60;) or by the seller (&#x60;MFN&#x60;).</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum FulfillmentChannelEnum
        {
            /// <summary>
            /// Enum MFN for value: MFN
            /// </summary>
            [EnumMember(Value = "MFN")]
            MFN = 1,

            /// <summary>
            /// Enum AFN for value: AFN
            /// </summary>
            [EnumMember(Value = "AFN")]
            AFN = 2
        }


        /// <summary>
        /// Whether the order was fulfilled by Amazon (&#x60;AFN&#x60;) or by the seller (&#x60;MFN&#x60;).
        /// </summary>
        /// <value>Whether the order was fulfilled by Amazon (&#x60;AFN&#x60;) or by the seller (&#x60;MFN&#x60;).</value>
        [DataMember(Name = "FulfillmentChannel", EmitDefaultValue = false)]
        public FulfillmentChannelEnum? FulfillmentChannel { get; set; }
        /// <summary>
        /// The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the &#x60;PaymentExecutionDetailItem&#x60; object, we recommend using the &#x60;PaymentMethodDetails&#x60; property to get payment method information.
        /// </summary>
        /// <value>The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the &#x60;PaymentExecutionDetailItem&#x60; object, we recommend using the &#x60;PaymentMethodDetails&#x60; property to get payment method information.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum PaymentMethodEnum
        {
            /// <summary>
            /// Enum COD for value: COD
            /// </summary>
            [EnumMember(Value = "COD")]
            COD = 1,

            /// <summary>
            /// Enum CVS for value: CVS
            /// </summary>
            [EnumMember(Value = "CVS")]
            CVS = 2,

            /// <summary>
            /// Enum Other for value: Other
            /// </summary>
            [EnumMember(Value = "Other")]
            Other = 3
        }


        /// <summary>
        /// The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the &#x60;PaymentExecutionDetailItem&#x60; object, we recommend using the &#x60;PaymentMethodDetails&#x60; property to get payment method information.
        /// </summary>
        /// <value>The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the &#x60;PaymentExecutionDetailItem&#x60; object, we recommend using the &#x60;PaymentMethodDetails&#x60; property to get payment method information.</value>
        [DataMember(Name = "PaymentMethod", EmitDefaultValue = false)]
        public PaymentMethodEnum? PaymentMethod { get; set; }

        /// <summary>
        /// Gets or Sets EasyShipShipmentStatus
        /// </summary>
        [DataMember(Name = "EasyShipShipmentStatus", EmitDefaultValue = false)]
        public EasyShipShipmentStatus? EasyShipShipmentStatus { get; set; }
        /// <summary>
        /// The order&#39;s type.
        /// </summary>
        /// <value>The order&#39;s type.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum OrderTypeEnum
        {
            /// <summary>
            /// Enum StandardOrder for value: StandardOrder
            /// </summary>
            [EnumMember(Value = "StandardOrder")]
            StandardOrder = 1,

            /// <summary>
            /// Enum LongLeadTimeOrder for value: LongLeadTimeOrder
            /// </summary>
            [EnumMember(Value = "LongLeadTimeOrder")]
            LongLeadTimeOrder = 2,

            /// <summary>
            /// Enum Preorder for value: Preorder
            /// </summary>
            [EnumMember(Value = "Preorder")]
            Preorder = 3,

            /// <summary>
            /// Enum BackOrder for value: BackOrder
            /// </summary>
            [EnumMember(Value = "BackOrder")]
            BackOrder = 4,

            /// <summary>
            /// Enum SourcingOnDemandOrder for value: SourcingOnDemandOrder
            /// </summary>
            [EnumMember(Value = "SourcingOnDemandOrder")]
            SourcingOnDemandOrder = 5
        }


        /// <summary>
        /// The order&#39;s type.
        /// </summary>
        /// <value>The order&#39;s type.</value>
        [DataMember(Name = "OrderType", EmitDefaultValue = false)]
        public OrderTypeEnum? OrderType { get; set; }
        /// <summary>
        /// The buyer&#39;s invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace.
        /// </summary>
        /// <value>The buyer&#39;s invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum BuyerInvoicePreferenceEnum
        {
            /// <summary>
            /// Enum INDIVIDUAL for value: INDIVIDUAL
            /// </summary>
            [EnumMember(Value = "INDIVIDUAL")]
            INDIVIDUAL = 1,

            /// <summary>
            /// Enum BUSINESS for value: BUSINESS
            /// </summary>
            [EnumMember(Value = "BUSINESS")]
            BUSINESS = 2
        }


        /// <summary>
        /// The buyer&#39;s invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace.
        /// </summary>
        /// <value>The buyer&#39;s invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace.</value>
        [DataMember(Name = "BuyerInvoicePreference", EmitDefaultValue = false)]
        public BuyerInvoicePreferenceEnum? BuyerInvoicePreference { get; set; }

        /// <summary>
        /// Gets or Sets ElectronicInvoiceStatus
        /// </summary>
        [DataMember(Name = "ElectronicInvoiceStatus", EmitDefaultValue = false)]
        public ElectronicInvoiceStatus? ElectronicInvoiceStatus { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="Order" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected Order() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="Order" /> class.
        /// </summary>
        /// <param name="amazonOrderId">An Amazon-defined order identifier, in 3-7-7 format. (required).</param>
        /// <param name="sellerOrderId">A seller-defined order identifier..</param>
        /// <param name="purchaseDate">The date when the order was created. (required).</param>
        /// <param name="lastUpdateDate">The date when the order was last updated.  __Note__: &#x60;LastUpdateDate&#x60; is returned with an incorrect date for orders that were last updated before 2009-04-01. (required).</param>
        /// <param name="orderStatus">The current order status. (required).</param>
        /// <param name="fulfillmentChannel">Whether the order was fulfilled by Amazon (&#x60;AFN&#x60;) or by the seller (&#x60;MFN&#x60;)..</param>
        /// <param name="salesChannel">The sales channel for the first item in the order..</param>
        /// <param name="orderChannel">The order channel for the first item in the order..</param>
        /// <param name="shipServiceLevel">The order&#39;s shipment service level..</param>
        /// <param name="orderTotal">orderTotal.</param>
        /// <param name="numberOfItemsShipped">The number of items shipped..</param>
        /// <param name="numberOfItemsUnshipped">The number of items unshipped..</param>
        /// <param name="paymentExecutionDetail">A list of payment execution detail items..</param>
        /// <param name="paymentMethod">The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the &#x60;PaymentExecutionDetailItem&#x60; object, we recommend using the &#x60;PaymentMethodDetails&#x60; property to get payment method information..</param>
        /// <param name="paymentMethodDetails">A list of payment method detail items..</param>
        /// <param name="marketplaceId">The identifier for the marketplace where the order was placed..</param>
        /// <param name="shipmentServiceLevelCategory">The shipment service level category for the order.  **Possible values**: &#x60;Expedited&#x60;, &#x60;FreeEconomy&#x60;, &#x60;NextDay&#x60;, &#x60;Priority&#x60;, &#x60;SameDay&#x60;, &#x60;SecondDay&#x60;, &#x60;Scheduled&#x60;, and &#x60;Standard&#x60;..</param>
        /// <param name="easyShipShipmentStatus">easyShipShipmentStatus.</param>
        /// <param name="cbaDisplayableShippingLabel">Custom ship label for Checkout by Amazon (CBA)..</param>
        /// <param name="orderType">The order&#39;s type..</param>
        /// <param name="earliestShipDate">The start of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;EarliestShipDate&#x60; might not be returned for orders placed before February 1, 2013..</param>
        /// <param name="latestShipDate">The end of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;LatestShipDate&#x60; might not be returned for orders placed before February 1, 2013..</param>
        /// <param name="earliestDeliveryDate">The start of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders..</param>
        /// <param name="latestDeliveryDate">The end of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders that do not have a &#x60;PendingAvailability&#x60;, &#x60;Pending&#x60;, or &#x60;Canceled&#x60; status..</param>
        /// <param name="isBusinessOrder">When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer..</param>
        /// <param name="isPrime">When true, the order is a seller-fulfilled Amazon Prime order..</param>
        /// <param name="isPremiumOrder">When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, refer to \&quot;Premium Shipping Options\&quot; in the Seller Central Help for your marketplace..</param>
        /// <param name="isGlobalExpressEnabled">When true, the order is a &#x60;GlobalExpress&#x60; order..</param>
        /// <param name="replacedOrderId">The order ID value for the order that is being replaced. Returned only if IsReplacementOrder &#x3D; true..</param>
        /// <param name="isReplacementOrder">When true, this is a replacement order..</param>
        /// <param name="promiseResponseDueDate">Indicates the date by which the seller must respond to the buyer with an estimated ship date. Only returned for Sourcing on Demand orders..</param>
        /// <param name="isEstimatedShipDateSet">When true, the estimated ship date is set for the order. Only returned for Sourcing on Demand orders..</param>
        /// <param name="isSoldByAB">When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller..</param>
        /// <param name="isIBA">When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller..</param>
        /// <param name="defaultShipFromLocationAddress">defaultShipFromLocationAddress.</param>
        /// <param name="buyerInvoicePreference">The buyer&#39;s invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace..</param>
        /// <param name="buyerTaxInformation">buyerTaxInformation.</param>
        /// <param name="fulfillmentInstruction">fulfillmentInstruction.</param>
        /// <param name="isISPU">When true, this order is marked to be picked up from a store rather than delivered..</param>
        /// <param name="isAccessPointOrder">When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers..</param>
        /// <param name="marketplaceTaxInfo">marketplaceTaxInfo.</param>
        /// <param name="sellerDisplayName">The seller’s friendly name registered in the marketplace where the sale took place. Sellers can use this data to issue electronic invoices for orders in Brazil.  **Note**: This attribute is only available in the Brazil marketplace for the orders with &#x60;Pending&#x60; or &#x60;Unshipped&#x60; status..</param>
        /// <param name="shippingAddress">shippingAddress.</param>
        /// <param name="buyerInfo">buyerInfo.</param>
        /// <param name="automatedShippingSettings">automatedShippingSettings.</param>
        /// <param name="hasRegulatedItems">Whether the order contains regulated items which may require additional approval steps before being fulfilled..</param>
        /// <param name="electronicInvoiceStatus">electronicInvoiceStatus.</param>
        public Order(string amazonOrderId = default(string), string sellerOrderId = default(string), string purchaseDate = default(string), string lastUpdateDate = default(string), OrderStatusEnum orderStatus = default(OrderStatusEnum), FulfillmentChannelEnum? fulfillmentChannel = default(FulfillmentChannelEnum?), string salesChannel = default(string), string orderChannel = default(string), string shipServiceLevel = default(string), Money orderTotal = default(Money), int numberOfItemsShipped = default(int), int numberOfItemsUnshipped = default(int), List<PaymentExecutionDetailItem> paymentExecutionDetail = default(List<PaymentExecutionDetailItem>), PaymentMethodEnum? paymentMethod = default(PaymentMethodEnum?), List<string> paymentMethodDetails = default(List<string>), string marketplaceId = default(string), string shipmentServiceLevelCategory = default(string), EasyShipShipmentStatus? easyShipShipmentStatus = default(EasyShipShipmentStatus?), string cbaDisplayableShippingLabel = default(string), OrderTypeEnum? orderType = default(OrderTypeEnum?), string earliestShipDate = default(string), string latestShipDate = default(string), string earliestDeliveryDate = default(string), string latestDeliveryDate = default(string), bool isBusinessOrder = default(bool), bool isPrime = default(bool), bool isPremiumOrder = default(bool), bool isGlobalExpressEnabled = default(bool), string replacedOrderId = default(string), bool isReplacementOrder = default(bool), string promiseResponseDueDate = default(string), bool isEstimatedShipDateSet = default(bool), bool isSoldByAB = default(bool), bool isIBA = default(bool), Address defaultShipFromLocationAddress = default(Address), BuyerInvoicePreferenceEnum? buyerInvoicePreference = default(BuyerInvoicePreferenceEnum?), BuyerTaxInformation buyerTaxInformation = default(BuyerTaxInformation), FulfillmentInstruction fulfillmentInstruction = default(FulfillmentInstruction), bool isISPU = default(bool), bool isAccessPointOrder = default(bool), MarketplaceTaxInfo marketplaceTaxInfo = default(MarketplaceTaxInfo), string sellerDisplayName = default(string), Address shippingAddress = default(Address), BuyerInfo buyerInfo = default(BuyerInfo), AutomatedShippingSettings automatedShippingSettings = default(AutomatedShippingSettings), bool hasRegulatedItems = default(bool), ElectronicInvoiceStatus? electronicInvoiceStatus = default(ElectronicInvoiceStatus?))
        {
            // to ensure "amazonOrderId" is required (not null)
            if (amazonOrderId == null)
            {
                throw new ArgumentNullException("amazonOrderId is a required property for Order and cannot be null");
            }
            this.AmazonOrderId = amazonOrderId;
            // to ensure "purchaseDate" is required (not null)
            if (purchaseDate == null)
            {
                throw new ArgumentNullException("purchaseDate is a required property for Order and cannot be null");
            }
            this.PurchaseDate = purchaseDate;
            // to ensure "lastUpdateDate" is required (not null)
            if (lastUpdateDate == null)
            {
                throw new ArgumentNullException("lastUpdateDate is a required property for Order and cannot be null");
            }
            this.LastUpdateDate = lastUpdateDate;
            this.OrderStatus = orderStatus;
            this.SellerOrderId = sellerOrderId;
            this.FulfillmentChannel = fulfillmentChannel;
            this.SalesChannel = salesChannel;
            this.OrderChannel = orderChannel;
            this.ShipServiceLevel = shipServiceLevel;
            this.OrderTotal = orderTotal;
            this.NumberOfItemsShipped = numberOfItemsShipped;
            this.NumberOfItemsUnshipped = numberOfItemsUnshipped;
            this.PaymentExecutionDetail = paymentExecutionDetail;
            this.PaymentMethod = paymentMethod;
            this.PaymentMethodDetails = paymentMethodDetails;
            this.MarketplaceId = marketplaceId;
            this.ShipmentServiceLevelCategory = shipmentServiceLevelCategory;
            this.EasyShipShipmentStatus = easyShipShipmentStatus;
            this.CbaDisplayableShippingLabel = cbaDisplayableShippingLabel;
            this.OrderType = orderType;
            this.EarliestShipDate = earliestShipDate;
            this.LatestShipDate = latestShipDate;
            this.EarliestDeliveryDate = earliestDeliveryDate;
            this.LatestDeliveryDate = latestDeliveryDate;
            this.IsBusinessOrder = isBusinessOrder;
            this.IsPrime = isPrime;
            this.IsPremiumOrder = isPremiumOrder;
            this.IsGlobalExpressEnabled = isGlobalExpressEnabled;
            this.ReplacedOrderId = replacedOrderId;
            this.IsReplacementOrder = isReplacementOrder;
            this.PromiseResponseDueDate = promiseResponseDueDate;
            this.IsEstimatedShipDateSet = isEstimatedShipDateSet;
            this.IsSoldByAB = isSoldByAB;
            this.IsIBA = isIBA;
            this.DefaultShipFromLocationAddress = defaultShipFromLocationAddress;
            this.BuyerInvoicePreference = buyerInvoicePreference;
            this.BuyerTaxInformation = buyerTaxInformation;
            this.FulfillmentInstruction = fulfillmentInstruction;
            this.IsISPU = isISPU;
            this.IsAccessPointOrder = isAccessPointOrder;
            this.MarketplaceTaxInfo = marketplaceTaxInfo;
            this.SellerDisplayName = sellerDisplayName;
            this.ShippingAddress = shippingAddress;
            this.BuyerInfo = buyerInfo;
            this.AutomatedShippingSettings = automatedShippingSettings;
            this.HasRegulatedItems = hasRegulatedItems;
            this.ElectronicInvoiceStatus = electronicInvoiceStatus;
        }

        /// <summary>
        /// An Amazon-defined order identifier, in 3-7-7 format.
        /// </summary>
        /// <value>An Amazon-defined order identifier, in 3-7-7 format.</value>
        [DataMember(Name = "AmazonOrderId", IsRequired = true, EmitDefaultValue = true)]
        public string AmazonOrderId { get; set; }

        /// <summary>
        /// A seller-defined order identifier.
        /// </summary>
        /// <value>A seller-defined order identifier.</value>
        [DataMember(Name = "SellerOrderId", EmitDefaultValue = false)]
        public string SellerOrderId { get; set; }

        /// <summary>
        /// The date when the order was created.
        /// </summary>
        /// <value>The date when the order was created.</value>
        [DataMember(Name = "PurchaseDate", IsRequired = true, EmitDefaultValue = true)]
        public string PurchaseDate { get; set; }

        /// <summary>
        /// The date when the order was last updated.  __Note__: &#x60;LastUpdateDate&#x60; is returned with an incorrect date for orders that were last updated before 2009-04-01.
        /// </summary>
        /// <value>The date when the order was last updated.  __Note__: &#x60;LastUpdateDate&#x60; is returned with an incorrect date for orders that were last updated before 2009-04-01.</value>
        [DataMember(Name = "LastUpdateDate", IsRequired = true, EmitDefaultValue = true)]
        public string LastUpdateDate { get; set; }

        /// <summary>
        /// The sales channel for the first item in the order.
        /// </summary>
        /// <value>The sales channel for the first item in the order.</value>
        [DataMember(Name = "SalesChannel", EmitDefaultValue = false)]
        public string SalesChannel { get; set; }

        /// <summary>
        /// The order channel for the first item in the order.
        /// </summary>
        /// <value>The order channel for the first item in the order.</value>
        [DataMember(Name = "OrderChannel", EmitDefaultValue = false)]
        public string OrderChannel { get; set; }

        /// <summary>
        /// The order&#39;s shipment service level.
        /// </summary>
        /// <value>The order&#39;s shipment service level.</value>
        [DataMember(Name = "ShipServiceLevel", EmitDefaultValue = false)]
        public string ShipServiceLevel { get; set; }

        /// <summary>
        /// Gets or Sets OrderTotal
        /// </summary>
        [DataMember(Name = "OrderTotal", EmitDefaultValue = false)]
        public Money OrderTotal { get; set; }

        /// <summary>
        /// The number of items shipped.
        /// </summary>
        /// <value>The number of items shipped.</value>
        [DataMember(Name = "NumberOfItemsShipped", EmitDefaultValue = false)]
        public int NumberOfItemsShipped { get; set; }

        /// <summary>
        /// The number of items unshipped.
        /// </summary>
        /// <value>The number of items unshipped.</value>
        [DataMember(Name = "NumberOfItemsUnshipped", EmitDefaultValue = false)]
        public int NumberOfItemsUnshipped { get; set; }

        /// <summary>
        /// A list of payment execution detail items.
        /// </summary>
        /// <value>A list of payment execution detail items.</value>
        [DataMember(Name = "PaymentExecutionDetail", EmitDefaultValue = false)]
        public List<PaymentExecutionDetailItem> PaymentExecutionDetail { get; set; }

        /// <summary>
        /// A list of payment method detail items.
        /// </summary>
        /// <value>A list of payment method detail items.</value>
        [DataMember(Name = "PaymentMethodDetails", EmitDefaultValue = false)]
        public List<string> PaymentMethodDetails { get; set; }

        /// <summary>
        /// The identifier for the marketplace where the order was placed.
        /// </summary>
        /// <value>The identifier for the marketplace where the order was placed.</value>
        [DataMember(Name = "MarketplaceId", EmitDefaultValue = false)]
        public string MarketplaceId { get; set; }

        /// <summary>
        /// The shipment service level category for the order.  **Possible values**: &#x60;Expedited&#x60;, &#x60;FreeEconomy&#x60;, &#x60;NextDay&#x60;, &#x60;Priority&#x60;, &#x60;SameDay&#x60;, &#x60;SecondDay&#x60;, &#x60;Scheduled&#x60;, and &#x60;Standard&#x60;.
        /// </summary>
        /// <value>The shipment service level category for the order.  **Possible values**: &#x60;Expedited&#x60;, &#x60;FreeEconomy&#x60;, &#x60;NextDay&#x60;, &#x60;Priority&#x60;, &#x60;SameDay&#x60;, &#x60;SecondDay&#x60;, &#x60;Scheduled&#x60;, and &#x60;Standard&#x60;.</value>
        [DataMember(Name = "ShipmentServiceLevelCategory", EmitDefaultValue = false)]
        public string ShipmentServiceLevelCategory { get; set; }

        /// <summary>
        /// Custom ship label for Checkout by Amazon (CBA).
        /// </summary>
        /// <value>Custom ship label for Checkout by Amazon (CBA).</value>
        [DataMember(Name = "CbaDisplayableShippingLabel", EmitDefaultValue = false)]
        public string CbaDisplayableShippingLabel { get; set; }

        /// <summary>
        /// The start of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;EarliestShipDate&#x60; might not be returned for orders placed before February 1, 2013.
        /// </summary>
        /// <value>The start of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;EarliestShipDate&#x60; might not be returned for orders placed before February 1, 2013.</value>
        [DataMember(Name = "EarliestShipDate", EmitDefaultValue = false)]
        public string EarliestShipDate { get; set; }

        /// <summary>
        /// The end of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;LatestShipDate&#x60; might not be returned for orders placed before February 1, 2013.
        /// </summary>
        /// <value>The end of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: &#x60;LatestShipDate&#x60; might not be returned for orders placed before February 1, 2013.</value>
        [DataMember(Name = "LatestShipDate", EmitDefaultValue = false)]
        public string LatestShipDate { get; set; }

        /// <summary>
        /// The start of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.
        /// </summary>
        /// <value>The start of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.</value>
        [DataMember(Name = "EarliestDeliveryDate", EmitDefaultValue = false)]
        public string EarliestDeliveryDate { get; set; }

        /// <summary>
        /// The end of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders that do not have a &#x60;PendingAvailability&#x60;, &#x60;Pending&#x60;, or &#x60;Canceled&#x60; status.
        /// </summary>
        /// <value>The end of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders that do not have a &#x60;PendingAvailability&#x60;, &#x60;Pending&#x60;, or &#x60;Canceled&#x60; status.</value>
        [DataMember(Name = "LatestDeliveryDate", EmitDefaultValue = false)]
        public string LatestDeliveryDate { get; set; }

        /// <summary>
        /// When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer.
        /// </summary>
        /// <value>When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer.</value>
        [DataMember(Name = "IsBusinessOrder", EmitDefaultValue = true)]
        public bool IsBusinessOrder { get; set; }

        /// <summary>
        /// When true, the order is a seller-fulfilled Amazon Prime order.
        /// </summary>
        /// <value>When true, the order is a seller-fulfilled Amazon Prime order.</value>
        [DataMember(Name = "IsPrime", EmitDefaultValue = true)]
        public bool IsPrime { get; set; }

        /// <summary>
        /// When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, refer to \&quot;Premium Shipping Options\&quot; in the Seller Central Help for your marketplace.
        /// </summary>
        /// <value>When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, refer to \&quot;Premium Shipping Options\&quot; in the Seller Central Help for your marketplace.</value>
        [DataMember(Name = "IsPremiumOrder", EmitDefaultValue = true)]
        public bool IsPremiumOrder { get; set; }

        /// <summary>
        /// When true, the order is a &#x60;GlobalExpress&#x60; order.
        /// </summary>
        /// <value>When true, the order is a &#x60;GlobalExpress&#x60; order.</value>
        [DataMember(Name = "IsGlobalExpressEnabled", EmitDefaultValue = true)]
        public bool IsGlobalExpressEnabled { get; set; }

        /// <summary>
        /// The order ID value for the order that is being replaced. Returned only if IsReplacementOrder &#x3D; true.
        /// </summary>
        /// <value>The order ID value for the order that is being replaced. Returned only if IsReplacementOrder &#x3D; true.</value>
        [DataMember(Name = "ReplacedOrderId", EmitDefaultValue = false)]
        public string ReplacedOrderId { get; set; }

        /// <summary>
        /// When true, this is a replacement order.
        /// </summary>
        /// <value>When true, this is a replacement order.</value>
        [DataMember(Name = "IsReplacementOrder", EmitDefaultValue = true)]
        public bool IsReplacementOrder { get; set; }

        /// <summary>
        /// Indicates the date by which the seller must respond to the buyer with an estimated ship date. Only returned for Sourcing on Demand orders.
        /// </summary>
        /// <value>Indicates the date by which the seller must respond to the buyer with an estimated ship date. Only returned for Sourcing on Demand orders.</value>
        [DataMember(Name = "PromiseResponseDueDate", EmitDefaultValue = false)]
        public string PromiseResponseDueDate { get; set; }

        /// <summary>
        /// When true, the estimated ship date is set for the order. Only returned for Sourcing on Demand orders.
        /// </summary>
        /// <value>When true, the estimated ship date is set for the order. Only returned for Sourcing on Demand orders.</value>
        [DataMember(Name = "IsEstimatedShipDateSet", EmitDefaultValue = true)]
        public bool IsEstimatedShipDateSet { get; set; }

        /// <summary>
        /// When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.
        /// </summary>
        /// <value>When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.</value>
        [DataMember(Name = "IsSoldByAB", EmitDefaultValue = true)]
        public bool IsSoldByAB { get; set; }

        /// <summary>
        /// When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.
        /// </summary>
        /// <value>When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.</value>
        [DataMember(Name = "IsIBA", EmitDefaultValue = true)]
        public bool IsIBA { get; set; }

        /// <summary>
        /// Gets or Sets DefaultShipFromLocationAddress
        /// </summary>
        [DataMember(Name = "DefaultShipFromLocationAddress", EmitDefaultValue = false)]
        public Address DefaultShipFromLocationAddress { get; set; }

        /// <summary>
        /// Gets or Sets BuyerTaxInformation
        /// </summary>
        [DataMember(Name = "BuyerTaxInformation", EmitDefaultValue = false)]
        public BuyerTaxInformation BuyerTaxInformation { get; set; }

        /// <summary>
        /// Gets or Sets FulfillmentInstruction
        /// </summary>
        [DataMember(Name = "FulfillmentInstruction", EmitDefaultValue = false)]
        public FulfillmentInstruction FulfillmentInstruction { get; set; }

        /// <summary>
        /// When true, this order is marked to be picked up from a store rather than delivered.
        /// </summary>
        /// <value>When true, this order is marked to be picked up from a store rather than delivered.</value>
        [DataMember(Name = "IsISPU", EmitDefaultValue = true)]
        public bool IsISPU { get; set; }

        /// <summary>
        /// When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers.
        /// </summary>
        /// <value>When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers.</value>
        [DataMember(Name = "IsAccessPointOrder", EmitDefaultValue = true)]
        public bool IsAccessPointOrder { get; set; }

        /// <summary>
        /// Gets or Sets MarketplaceTaxInfo
        /// </summary>
        [DataMember(Name = "MarketplaceTaxInfo", EmitDefaultValue = false)]
        public MarketplaceTaxInfo MarketplaceTaxInfo { get; set; }

        /// <summary>
        /// The seller’s friendly name registered in the marketplace where the sale took place. Sellers can use this data to issue electronic invoices for orders in Brazil.  **Note**: This attribute is only available in the Brazil marketplace for the orders with &#x60;Pending&#x60; or &#x60;Unshipped&#x60; status.
        /// </summary>
        /// <value>The seller’s friendly name registered in the marketplace where the sale took place. Sellers can use this data to issue electronic invoices for orders in Brazil.  **Note**: This attribute is only available in the Brazil marketplace for the orders with &#x60;Pending&#x60; or &#x60;Unshipped&#x60; status.</value>
        [DataMember(Name = "SellerDisplayName", EmitDefaultValue = false)]
        public string SellerDisplayName { get; set; }

        /// <summary>
        /// Gets or Sets ShippingAddress
        /// </summary>
        [DataMember(Name = "ShippingAddress", EmitDefaultValue = false)]
        public Address ShippingAddress { get; set; }

        /// <summary>
        /// Gets or Sets BuyerInfo
        /// </summary>
        [DataMember(Name = "BuyerInfo", EmitDefaultValue = false)]
        public BuyerInfo BuyerInfo { get; set; }

        /// <summary>
        /// Gets or Sets AutomatedShippingSettings
        /// </summary>
        [DataMember(Name = "AutomatedShippingSettings", EmitDefaultValue = false)]
        public AutomatedShippingSettings AutomatedShippingSettings { get; set; }

        /// <summary>
        /// Whether the order contains regulated items which may require additional approval steps before being fulfilled.
        /// </summary>
        /// <value>Whether the order contains regulated items which may require additional approval steps before being fulfilled.</value>
        [DataMember(Name = "HasRegulatedItems", EmitDefaultValue = true)]
        public bool HasRegulatedItems { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class Order {\n");
            sb.Append("  AmazonOrderId: ").Append(AmazonOrderId).Append("\n");
            sb.Append("  SellerOrderId: ").Append(SellerOrderId).Append("\n");
            sb.Append("  PurchaseDate: ").Append(PurchaseDate).Append("\n");
            sb.Append("  LastUpdateDate: ").Append(LastUpdateDate).Append("\n");
            sb.Append("  OrderStatus: ").Append(OrderStatus).Append("\n");
            sb.Append("  FulfillmentChannel: ").Append(FulfillmentChannel).Append("\n");
            sb.Append("  SalesChannel: ").Append(SalesChannel).Append("\n");
            sb.Append("  OrderChannel: ").Append(OrderChannel).Append("\n");
            sb.Append("  ShipServiceLevel: ").Append(ShipServiceLevel).Append("\n");
            sb.Append("  OrderTotal: ").Append(OrderTotal).Append("\n");
            sb.Append("  NumberOfItemsShipped: ").Append(NumberOfItemsShipped).Append("\n");
            sb.Append("  NumberOfItemsUnshipped: ").Append(NumberOfItemsUnshipped).Append("\n");
            sb.Append("  PaymentExecutionDetail: ").Append(PaymentExecutionDetail).Append("\n");
            sb.Append("  PaymentMethod: ").Append(PaymentMethod).Append("\n");
            sb.Append("  PaymentMethodDetails: ").Append(PaymentMethodDetails).Append("\n");
            sb.Append("  MarketplaceId: ").Append(MarketplaceId).Append("\n");
            sb.Append("  ShipmentServiceLevelCategory: ").Append(ShipmentServiceLevelCategory).Append("\n");
            sb.Append("  EasyShipShipmentStatus: ").Append(EasyShipShipmentStatus).Append("\n");
            sb.Append("  CbaDisplayableShippingLabel: ").Append(CbaDisplayableShippingLabel).Append("\n");
            sb.Append("  OrderType: ").Append(OrderType).Append("\n");
            sb.Append("  EarliestShipDate: ").Append(EarliestShipDate).Append("\n");
            sb.Append("  LatestShipDate: ").Append(LatestShipDate).Append("\n");
            sb.Append("  EarliestDeliveryDate: ").Append(EarliestDeliveryDate).Append("\n");
            sb.Append("  LatestDeliveryDate: ").Append(LatestDeliveryDate).Append("\n");
            sb.Append("  IsBusinessOrder: ").Append(IsBusinessOrder).Append("\n");
            sb.Append("  IsPrime: ").Append(IsPrime).Append("\n");
            sb.Append("  IsPremiumOrder: ").Append(IsPremiumOrder).Append("\n");
            sb.Append("  IsGlobalExpressEnabled: ").Append(IsGlobalExpressEnabled).Append("\n");
            sb.Append("  ReplacedOrderId: ").Append(ReplacedOrderId).Append("\n");
            sb.Append("  IsReplacementOrder: ").Append(IsReplacementOrder).Append("\n");
            sb.Append("  PromiseResponseDueDate: ").Append(PromiseResponseDueDate).Append("\n");
            sb.Append("  IsEstimatedShipDateSet: ").Append(IsEstimatedShipDateSet).Append("\n");
            sb.Append("  IsSoldByAB: ").Append(IsSoldByAB).Append("\n");
            sb.Append("  IsIBA: ").Append(IsIBA).Append("\n");
            sb.Append("  DefaultShipFromLocationAddress: ").Append(DefaultShipFromLocationAddress).Append("\n");
            sb.Append("  BuyerInvoicePreference: ").Append(BuyerInvoicePreference).Append("\n");
            sb.Append("  BuyerTaxInformation: ").Append(BuyerTaxInformation).Append("\n");
            sb.Append("  FulfillmentInstruction: ").Append(FulfillmentInstruction).Append("\n");
            sb.Append("  IsISPU: ").Append(IsISPU).Append("\n");
            sb.Append("  IsAccessPointOrder: ").Append(IsAccessPointOrder).Append("\n");
            sb.Append("  MarketplaceTaxInfo: ").Append(MarketplaceTaxInfo).Append("\n");
            sb.Append("  SellerDisplayName: ").Append(SellerDisplayName).Append("\n");
            sb.Append("  ShippingAddress: ").Append(ShippingAddress).Append("\n");
            sb.Append("  BuyerInfo: ").Append(BuyerInfo).Append("\n");
            sb.Append("  AutomatedShippingSettings: ").Append(AutomatedShippingSettings).Append("\n");
            sb.Append("  HasRegulatedItems: ").Append(HasRegulatedItems).Append("\n");
            sb.Append("  ElectronicInvoiceStatus: ").Append(ElectronicInvoiceStatus).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
